import Loading from '@/components/loading';
import Vue from 'vue';
import Router from 'vue-router';
import TokenOutDialog from '@/components/TokenOutDialog';

Vue.use(Router);
/**
 * meta的说明：
 * 每个页面的title都需要在router中进行配置
 * 如果页面无需登录即可访问，则public的值为true
 */
let router = new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [{
      path: '/splash',
      name: 'Splash',
      meta: {
        title: '请稍后',
        public: true
      },
      component: () => import('@/views/Splash')
    },
    {
      path: '/pagenotfound',
      name: 'PageNotFound',
      meta: {
        title: '出错了',
        public: true
      },
      component: () => import('@/views/PageNotFound')
    },
    {
      path: '/login',
      name: 'Login',
      meta: {
        title: '登录',
        public: true
      },
      component: () =>
        import( /* webpackChunkName: "login" */ '@/views/newlogin/NewLogin')
    },
    {
      path: '/login/captcha',
      name: 'LoginCaptcha',
      meta: {
        title: '输入验证码',
        public: true
      },
      component: () =>
        import( /* webpackChunkName: "login" */ '@/views/newlogin/CaptchaView')
    },
    {
      path: '/login/password',
      name: 'LoginPassword',
      meta: {
        title: '输入密码',
        public: true
      },
      component: () =>
        import( /* webpackChunkName: "login" */ '@/views/newlogin/PasswordView')
    },
    {
      path: '/login/setpassword',
      name: 'SetLoginPassword',
      meta: {
        title: '设置登录密码',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "login" */
          '@/views/newlogin/SetLoginPassword'
        )
    },
    {
      path: '/useragreement',
      name: 'UserAgreement',
      meta: {
        title: '用户协议',
        public: true
      },
      component: () =>
        import( /* webpackChunkName: "login" */ '@/views/login/UserAgreement')
    },
    {
      path: '/home',
      name: 'Home',
      meta: {
        title: '平安到家'
      },
      component: () =>
        import( /* webpackChunkName: "home" */ '@/views/home/NewHome')
    },
    {
      path: '/message',
      name: 'Message',
      meta: {
        title: '消息'
      },
      component: () =>
        import( /* webpackChunkName: "message" */ '@/views/home/message/Message')
    },
    {
      path: '/message/sysmessage',
      name: 'SystemMessage',
      meta: {
        title: '系统消息'
      },
      component: () =>
        import(
          /* webpackChunkName: "message" */
          '@/views/home/message/SystemMessageList'
        )
    },
    {
      path: '/message/allotmessage',
      name: 'AllotMessage',
      meta: {
        title: '行程消息'
      },
      component: () =>
        import(
          /* webpackChunkName: "message" */
          '@/views/home/message/AllotMessageList'
        )
    },
    {
      path: '/message/activitymessage',
      name: 'ActivityMessage',
      meta: {
        title: '活动消息'
      },
      component: () =>
        import(
          /* webpackChunkName: "message" */
          '@/views/home/message/ActivityMessageList'
        )
    },
    {
      path: '/message/hudongmessage',
      name: 'HudongMessage',
      meta: {
        title: '互动消息'
      },
      component: () =>
        import(
          /* webpackChunkName: "message" */
          '@/views/home/message/HudongMessageList'
        )
    },
    {
      path: '/home/selectcity',
      name: 'SelectCity',
      meta: {
        title: '城市选择'
      },
      component: () =>
        import( /* webpackChunkName: "home" */ '@/views/home/CitySelector')
    },
    {
      path: '/createorder/pinche',
      name: 'Pinche',
      component: () =>
        import( /* webpackChunkName: "order" */ '@/views/order/CreateOrder')
    },
    {
      path: '/createorder/baoche',
      name: 'Baoche',
      meta: {
        title: '包车'
      },
      component: () =>
        import( /* webpackChunkName: "order" */ '@/views/order/CreateOrder')
    },
    {
      path: '/createorder/dairen',
      name: 'Dairen',
      meta: {
        title: '代人叫车'
      },
      component: () =>
        import( /* webpackChunkName: "order" */ '@/views/order/CreateOrder')
    },
    {
      path: '/orderdetail',
      name: 'OrderDetail',
      component: () => import('@/views/payedorder/OrderDetail'),
      meta: {
        title: '订单详情',
        public: false
      }
    },
    {
      path: '/my/myAllot',
      name: 'MyAllot',
      meta: {
        title: '行程',
        public: false,
        continue: true
      },
      component: () => import( /* webpackChunkName: "my" */ '@/views/my/MyAllot')
    },
    {
      path: '/my/myWallet',
      name: 'MyWallet',
      meta: {
        title: '钱包',
        public: true
      },
      component: () =>
        import( /* webpackChunkName: "MyWallet" */ '@/views/my/MyWallet')
    },
    {
      path: '/my/MyWalletquestion',
      name: 'MyWalletquestion',
      meta: {
        title: '余额说明',
        public: true
      },
      component: () =>
        import( /* webpackChunkName: "my" */ '@/views/my/MyWalletquestion')
    },
    {
      path: '/my/MyWalletAllrecord',
      name: 'MyWalletAllrecord',
      meta: {
        title: '账户明细',
        public: true
      },
      component: () =>
        import( /* webpackChunkName: "my" */ '@/views/my/MyWalletAllrecord')
    },
    {
      path: '/my/MyWalletRecharge',
      name: 'MyWalletRecharge',
      meta: {
        title: '充值',
        public: true
      },
      component: () =>
        import( /* webpackChunkName: "my" */ '@/views/my/MyWalletRecharge')
    },
    {
      path: '/rechargeAgt',
      name: 'rechargeAgt',
      meta: {
        title: '用户充值协议',
        public: true
      },
      component: () =>
        import( /* webpackChunkName: "my" */ '@/views/my/rechargeAgt')
    },
    {
      path: '/my/MyWalletRechargeSuccess',
      name: 'MyWalletRechargeSuccess',
      meta: {
        title: '充值成功',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "my" */
          '@/views/my/MyWalletRechargeSuccess'
        )
    },
    {
      path: '/my/MyWalletRechargefail',
      name: 'MyWalletRechargefail',
      meta: {
        title: '充值失败',
        public: true
      },
      component: () =>
        import( /* webpackChunkName: "my" */ '@/views/my/MyWalletRechargefail')
    },
    {
      path: '/my/MyCoupon',
      name: 'MyCoupon',
      meta: {
        title: '优惠券',
        public: false,
        continue: true
      },
      component: () =>
        import( /* webpackChunkName: "my" */ '@/views/my/MyCoupon')
    },
    {
      path: '/my/MyUseCoupon',
      name: 'MyUseCoupon',
      meta: {
        title: '优惠券',
        public: false
      },
      component: () =>
        import( /* webpackChunkName: "my" */ '@/views/my/MyUseCoupon')
    },
    {
      path: '/my/MyCouponOut',
      name: 'MyCouponOut',
      meta: {
        title: '优惠券',
        public: false
      },
      component: () =>
        import( /* webpackChunkName: "my" */ '@/views/my/MyCouponOut')
    },
    {
      path: '/my/MyCouponExchange',
      name: 'MyCouponExchange',
      meta: {
        title: '兑换优惠券',
        public: true
      },
      component: () =>
        import( /* webpackChunkName: "my" */ '@/views/my/MyCouponExchange')
    },
    {
      path: '/my/getcoupon',
      name: 'getCoupon',
      meta: {
        title: '优惠券',
        public: true
      },
      component: () =>
        import( /* webpackChunkName: "my" */ '@/views/my/getCoupon')
    },
    {
      path: '/options/options',
      name: 'Options',
      meta: {
        title: '设置',
        public: false
      },
      component: () =>
        import( /* webpackChunkName: "options" */ '@/views/options/Options')
    },
    {
      path: '/options/accountSecurity',
      name: 'AccountSecurity',
      meta: {
        title: '账户安全',
        public: false
      },
      component: () =>
        import(
          /* webpackChunkName: "options" */
          '@/views/options/AccountSecurity'
        )
    },
    {
      path: '/options/authentication',
      name: 'Authentication',
      meta: {
        title: '实名认证',
        public: false
      },
      component: () =>
        import(
          /* webpackChunkName: "options" */
          '@/views/options/Authentication'
        )
    },
    {
      path: '/options/setPwd',
      name: 'SetPwd',
      meta: {
        title: '设置登录密码',
        public: true
      },
      component: () =>
        import( /* webpackChunkName: "options" */ '@/views/options/SetPwd')
    },
    {
      path: '/options/SetLoginPwd',
      name: 'SetLoginPwd',
      meta: {
        title: '设置登录密码', // 登录时未设置登录时候设置登录密码
        public: true
      },
      component: () =>
        import( /* webpackChunkName: "options" */ '@/views/options/SetLoginPwd')
    },
    {
      path: '/options/modifyPwd',
      name: 'ModifyPwd',
      meta: {
        title: '修改登录密码',
        public: true
      },
      component: () =>
        import( /* webpackChunkName: "options" */ '@/views/options/ModifyPwd')
    },
    {
      path: '/options/changeloginpwd',
      name: 'ChangeLoginPassword',
      meta: {
        title: '',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "options" */
          '@/views/options/ChangeLoginPassword'
        )
    },
    {
      path: '/options/changeloginpwd/captcha',
      name: 'ChangeLoginPasswordCaptcha',
      meta: {
        title: '输入验证码',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "options" */
          '@/views/options/ChangeLoginPasswordCaptcha'
        )
    },
    {
      path: '/options/changeloginpwd/phone',
      name: 'ChangeLoginPasswordPhone',
      meta: {
        title: '修改登录密码',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "options" */
          '@/views/options/ChangeLoginPasswordPhone'
        )
    },
    /* 新版 */
    {
      path: '/options/setloginpwd/phone',
      name: 'SetLoginPasswordPhone',
      meta: {
        title: '设置登录密码',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "options" */
          '@/views/options/SetLoginPasswordPhone'
        )
    },
    {
      path: '/options/modifyPwdNew',
      name: 'ModifyPwdNew',
      meta: {
        title: '修改登录密码',
        public: true
      },
      component: () =>
        import( /* webpackChunkName: "options" */ '@/views/options/ModifyPwdNew')
    },
    {
      path: '/options/changepaypwd',
      name: 'ChangePayPassword',
      meta: {
        title: '',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "options" */
          '@/views/options/ChangePayPassword'
        )
    },
    {
      path: '/options/changepaypwd/captcha',
      name: 'ChangePayPasswordCaptcha',
      meta: {
        title: '输入验证码',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "options" */
          '@/views/options/ChangePayPasswordCaptcha'
        )
    },
    {
      path: '/options/changepaypwd/phone',
      name: 'ChangePayPasswordPhone',
      meta: {
        title: '修改支付密码',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "options" */
          '@/views/options/ChangePayPasswordPhone'
        )
    },
    {
      path: '/options/setpaypwd/phone',
      name: 'SetPayPasswordPhone',
      meta: {
        title: '设置支付密码',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "options" */
          '@/views/options/SetPayPasswordPhone'
        )
    },
    {
      path: '/options/setPayPwd',
      name: 'SetPayPwd',
      meta: {
        title: '设置支付密码',
        public: true
      },
      component: () =>
        import( /* webpackChunkName: "options" */ '@/views/options/SetPayPwd')
    },
    {
      path: '/options/modifyPayPwd',
      name: 'ModifyPayPwd',
      meta: {
        title: '修改支付密码',
        public: true
      },
      component: () =>
        import( /* webpackChunkName: "options" */ '@/views/options/ModifyPayPwd')
    },
    {
      path: '/options/modifyPayPwdNew',
      name: 'ModifyPayPwdNew',
      meta: {
        title: '修改支付密码',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "options" */
          '@/views/options/ModifyPayPwdNew'
        )
    },
    {
      path: '/options/replacePhone',
      name: 'ReplacePhone',
      meta: {
        title: '更换手机号',
        public: true
      },
      component: () =>
        import( /* webpackChunkName: "options" */ '@/views/options/ReplacePhone')
    },
    {
      path: '/options/ReplacePhoneCaptcha',
      name: 'ReplacePhoneCaptcha',
      meta: {
        title: '输入验证码',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "options" */
          '@/views/options/ReplacePhoneCaptcha'
        )
    },
    {
      path: '/options/replaceNewPhone',
      name: 'ReplaceNewPhone',
      meta: {
        title: '更换手机号',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "options" */
          '@/views/options/ReplaceNewPhone'
        )
    },
    {
      path: '/options/ReplaceNewPhoneCaptcha',
      name: 'ReplaceNewPhoneCaptcha',
      meta: {
        title: '输入验证码',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "options" */
          '@/views/options/ReplaceNewPhoneCaptcha'
        )
    },
    {
      path: '/options/unsubscribe',
      name: 'Unsubscribe',
      meta: {
        title: '注销账号',
        public: true
      },
      component: () =>
        import( /* webpackChunkName: "options" */ '@/views/options/Unsubscribe')
    },
    {
      path: '/options/emergencyContact',
      name: 'EmergencyContact',
      meta: {
        title: '紧急联系人',
        public: false
      },
      component: () =>
        import(
          /* webpackChunkName: "options" */
          '@/views/options/EmergencyContact'
        )
    },
    {
      path: '/options/addContact',
      name: 'AddContact',
      meta: {
        title: '添加紧急联系人',
        public: false
      },
      component: () =>
        import( /* webpackChunkName: "options" */ '@/views/options/AddContact')
    },
    {
      path: '/options/editContact',
      name: 'EditContact',
      meta: {
        title: '编辑紧急联系人',
        public: false
      },
      component: () =>
        import( /* webpackChunkName: "options" */ '@/views/options/EditContact')
    },
    {
      path: '/options/aboutUs',
      name: 'AboutUs',
      meta: {
        title: '关于我们',
        public: true
      },
      component: () =>
        import( /* webpackChunkName: "options" */ '@/views/options/AboutUs')
    },
    {
      path: '/options/passengerNotes',
      name: 'PassengerNotes',
      meta: {
        title: '乘客须知',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "options" */
          '@/views/options/PassengerNotes'
        )
    },
    {
      path: '/personal/personalIndex',
      name: 'PersonalIndex',
      meta: {
        title: '个人信息',
        public: false,
        continue: true
      },
      component: () =>
        import(
          /* webpackChunkName: "personal" */
          '@/views/personal/PersonalIndex'
        )
    },
    {
      path: '/personal/setpPersonalName',
      name: 'SetpPersonalName',
      meta: {
        title: '设置昵称',
        public: false
      },
      component: () =>
        import(
          /* webpackChunkName: "personal" */
          '@/views/personal/SetpPersonalName'
        )
    },
    {
      path: '/personal/personalCode',
      name: 'PersonalCode',
      meta: {
        title: '我的二维码',
        public: false
      },
      component: () =>
        import(
          /* webpackChunkName: "personal" */
          '@/views/personal/PersonalCode'
        )
    },
    {
      path: '/payment/OrderPayment',
      name: 'OrderPayment',
      meta: {
        title: '订单支付',
        public: false
      },
      component: () =>
        import( /* webpackChunkName: "payment" */ '@/views/payment/OrderPayment')
    },
    {
      path: '/payment/OrderPayment/pay',
      name: 'OrderPaymentPay',
      meta: {
        title: '订单支付',
        public: false
      },
      component: () =>
        import( /* webpackChunkName: "payment" */ '@/views/payment/OrderPayment')
    },
    {
      path: '/phoneorder/phone',
      name: 'PhoneOrderGetPhone',
      meta: {
        title: '订单查询',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "phoneorder" */
          '@/views/phoneorder/GetPhone'
        )
    },
    {
      path: '/phoneorder/orderlist',
      name: 'PhoneOrderList',
      meta: {
        title: '未支付的订单',
        public: true
      },
      component: () =>
        import(
          /*webpackChunkName: "phoneorder"*/
          '@/views/phoneorder/PhoneOrderList'
        )
    },
    {
      path: '/phoneorder/payment',
      name: 'PhoneOrderPayment',
      meta: {
        title: '订单支付',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "phoneorder" */
          '@/views/phoneorder/PhoneOrderPayment'
        )
    },
    // 电话订单拉起支付
    {
      path: '/phoneorder/payment/pay',
      name: 'PhoneOrderPaymentPay',
      meta: {
        title: '订单支付',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "phoneorder" */
          '@/views/phoneorder/PhoneOrderPayment'
        )
    },
    {
      path: '/phoneorder/chargesphoneorderdetails',
      name: 'chargesPhoneOrderDetails',
      meta: {
        title: '费用明细',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "chargesDetails" */
          '@/views/phoneorder/chargesPhoneOrderDetails'
        )
    },
    {
      path: '/payedorder/tripCancel',
      name: 'TripCancel',
      meta: {
        title: '取消原因',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "payedorder" */
          '@/views/payedorder/tripCancel'
        )
    },
    {
      path: '/payedorder/safe',
      name: 'safe',
      meta: {
        title: '安全中心',
        public: false
      },
      component: () =>
        import( /* webpackChunkName: "payedorder" */ '@/views/payedorder/safe')
    },
    {
      path: '/joinallot',
      name: 'JoinAllot',
      meta: {
        title: '加入行程',
        public: true,
        continue: true
      },
      component: () =>
        import( /* webpackChunkName: "order" */ '@/views/order/JoinAllot')
    },
    {
      path: '/driverevaluate/evaluate',
      name: 'Evaluate',
      meta: {
        title: '评价',
        public: false
      },
      component: () =>
        import(
          /* webpackChunkName: "driverevaluate" */
          '@/views/driverevaluate/evaluate'
        )
    },
    {
      path: '/driverevaluate/seeEvaluate',
      name: 'SeeEvaluate',
      meta: {
        title: '查看评价',
        public: false
      },
      component: () =>
        import(
          /* webpackChunkName: "driverevaluate" */
          '@/views/driverevaluate/seeEvaluate'
        )
    },
    {
      path: '/driverevaluate/successEvaluate',
      name: 'SuccessEvaluate',
      meta: {
        title: '评价成功',
        public: false
      },
      component: () =>
        import(
          /* webpackChunkName: "driverevaluate" */
          '@/views/driverevaluate/successEvaluate'
        )
    },
    {
      path: '/passengerComplaints/complaints',
      name: 'Complaints',
      meta: {
        title: '投诉',
        public: false
      },
      component: () =>
        import(
          /* webpackChunkName: "passengerComplaints" */
          '@/views/passengerComplaints/complaints'
        )
    },
    {
      path: '/passengerComplaints/seeComplaints',
      name: 'SeeComplaints',
      meta: {
        title: '查看投诉',
        public: false
      },
      component: () =>
        import(
          /* webpackChunkName: "passengerComplaints" */
          '@/views/passengerComplaints/seeComplaints'
        )
    },
    {
      path: '/chargesDetails/chargesDetails',
      name: 'ChargesDetails',
      meta: {
        title: '费用明细',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "chargesDetails" */
          '@/views/chargesDetails/chargesDetails'
        )
    },
    {
      path: '/chargesDetails/beforechargesDetails',
      name: 'beforechargesDetails',
      meta: {
        title: '费用明细',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "chargesDetails" */
          '@/views/chargesDetails/beforechargesDetails'
        )
    },
    {
      path: '/chargesDetails/valuationRules',
      name: 'ValuationRules',
      meta: {
        title: '计价规则',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "chargesDetails" */
          '@/views/chargesDetails/valuationRules'
        )
    },
    {
      path: '/chargesDetails/beforevaluationRules',
      name: 'beforevaluationRules',
      meta: {
        title: '计价规则',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "chargesDetails" */
          '@/views/chargesDetails/beforevaluationRules'
        )
    },
    {
      path: '/shareorder',
      name: 'ShareOrder',
      meta: {
        title: '行程分享',
        public: true
      },
      component: () => import('@/views/shareorder/ShareOrder')
    },
    {
      path: '/taxishareorder',
      name: 'TaxiShareOrder',
      meta: {
        title: '行程分享',
        public: true
      },
      component: () => import('@/views/shareorder/TaxiOrder')
    },
    {
      path: '/incityshareorder',
      name: 'IncityShareOrder',
      meta: {
        title: '行程分享',
        public: true
      },
      component: () => import('@/views/shareorder/IncityShareOrder')
    },
    {
      path: '/invoice/invoiceIndex',
      name: 'invoiceIndex',
      meta: {
        title: '开具发票',
        public: true
      },
      component: () =>
        import( /* webpackChunkName: "invoice" */ '@/views/invoice/invoiceIndex')
    },
    {
      path: '/invoice/invoiceHistory',
      name: 'invoiceHistory',
      meta: {
        title: '开票历史',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "invoice" */
          '@/views/invoice/invoiceHistory'
        )
    },
    {
      path: '/invoice/invoiceList',
      name: 'invoiceList',
      meta: {
        title: '开具发票',
        public: true
      },
      component: () =>
        import( /* webpackChunkName: "invoice" */ '@/views/invoice/invoiceList')
    },
    {
      path: '/invoice/invoice',
      name: 'invoice',
      meta: {
        title: '开具发票',
        public: true
      },
      component: () =>
        import( /* webpackChunkName: "invoice" */ '@/views/invoice/invoice')
    },
    {
      path: '/invoice/invoiceDetails',
      name: 'invoiceDetails',
      meta: {
        title: '开票详情',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "invoice" */
          '@/views/invoice/invoiceDetails'
        )
    },
    {
      path: '/invoice/invoicetripList',
      name: 'invoicetripList',
      meta: {
        title: '所含行程',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "invoice" */
          '@/views/invoice/invoicetripList'
        )
    },
    {
      path: '/invoice/invoiceDescription',
      name: 'invoiceDescription',
      meta: {
        title: '开票说明',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "invoice" */
          '@/views/invoice/invoiceDescription'
        )
    },
    {
      path: '/result',
      name: 'result',
      meta: {
        title: '关闭',
        public: true
      },
      component: () =>
        import( /* webpackChunkName: "invoice" */ '@/views/login/result')
    },
    {
      path: '/taxi',
      name: 'homeTaxi',
      meta: {
        title: '出租车'
      },
      component: () =>
        import( /* webpackChunkName: "taxi" */ '@/views/taxi/HomeTaxi')
    },
    {
      path: '/taxi/taxi',
      name: 'taxi',
      meta: {
        title: '出租车'
      },
      component: () =>
        import( /* webpackChunkName: "taxi" */ '@/views/taxi/Taxi')
    },
    {
      path: '/taxi/taxitripCancel',
      name: 'taxitripCancel',
      meta: {
        title: '出租车取消原因',
        public: true
      },
      component: () =>
        import( /* webpackChunkName: "taxi" */ '@/views/taxi/TaxitripCancel')
    },
    {
      path: '/taxi/taxichargesDetails',
      name: 'taxichargesDetails',
      meta: {
        title: '出租车费用明细',
        public: true
      },
      component: () =>
        import( /* webpackChunkName: "taxi" */ '@/views/taxi/TaxichargesDetails')
    },
    {
      path: '/taxi/taxiCoupon',
      name: 'taxiCoupon',
      meta: {
        title: '出租车优惠券'
      },
      component: () =>
        import( /* webpackChunkName: "taxi" */ '@/views/taxi/TaxiCoupon')
    },
    {
      path: '/taxi/taxisafe',
      name: 'taxisafe',
      meta: {
        title: '出租车安全中心'
      },
      component: () =>
        import( /* webpackChunkName: "taxi" */ '@/views/taxi/Taxisafe')
    },
    {
      path: '/incity',
      name: 'homeIncity',
      meta: {
        title: '市内用车',
        public: false
      },
      component: () =>
        import( /* webpackChunkName: "incity" */ '@/views/incity/HomeIncity')
    },
    {
      path: '/incity/incity',
      name: 'incity',
      meta: {
        title: '市内用车',
        public: false
      },
      component: () =>
        import( /* webpackChunkName: "incity" */ '@/views/incity/Incity')
    },
    {
      path: '/incity/detail',
      name: 'incityDetail',
      meta: {
        title: '市内用车',
        public: false
      },
      component: () =>
        import(
          /* webpackChunkName: "incity" */
          '@/views/incity/IncityOrderDetail'
        )
    },
    {
      path: '/incity/incitycancelrule',
      name: 'IncityCancelRule',
      meta: {
        title: '乘客取消规则',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "incity" */
          '@/views/incity/IncityCancelRule'
        )
    },
    {
      path: '/incity/incityordercancel',
      name: 'IncityOrderCancel',
      meta: {
        title: '取消原因',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "incity" */
          '@/views/incity/IncityOrderCancel'
        )
    },
    {
      path: '/incity/incitychargesdetails',
      name: 'IncityChargesDetails',
      meta: {
        title: '费用明细',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "incity" */
          '@/views/incity/IncityChargesDetails'
        )
    },
    {
      path: '/incity/incityValuationRules',
      name: 'IncityValuationRules',
      meta: {
        title: '计价规则',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "incity" */
          '@/views/incity/IncityValuationRules'
        )
    },
    {
      path: '/incity/incityunpaidchargesdetails',
      name: 'IncityUnpaidChargesDetails',
      meta: {
        title: '费用明细',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "incity" */
          '@/views/incity/IncityUnpaidChargesDetails'
        )
    },
    {
      path: '/incity/incityunpaidvaluationrules',
      name: 'IncityUnpaidValuationRules',
      meta: {
        title: '计价规则',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "incity" */
          '@/views/incity/IncityUnpaidValuationRules'
        )
    },
    {
      path: '/incity/incitycoupon',
      name: 'IncityCoupon',
      meta: {
        title: '优惠券',
        public: true
      },
      component: () =>
        import( /* webpackChunkName: "incity" */ '@/views/incity/IncityCoupon')
    },
    {
      path: '/incity/incityorderpay',
      name: 'IncityOrderPay',
      meta: {
        title: '订单支付',
        public: true
      },
      component: () =>
        import( /* webpackChunkName: "incity" */ '@/views/incity/IncityOrderPay')
    },
    {
      path: '/incity/incitytrip',
      name: 'incityTrip',
      meta: {
        title: '行程规划',
        public: true
      },
      component: () =>
        import( /* webpackChunkName: "incity" */ '@/views/incity/incityTrip')
    },
    {
      path: '/incity/incitysafe',
      name: 'Incitysafe',
      meta: {
        title: '安全中心',
        public: true
      },
      component: () =>
        import( /* webpackChunkName: "incity" */ '@/views/incity/Incitysafe')
    },
    {
      path: '/options/legalrules',
      name: 'LegalRules',
      meta: {
        title: '法律条款与平台规则',
        public: true
      },
      component: () =>
        import( /* webpackChunkName: "options" */ '@/views/options/LegalRules')
    },
    {
      path: '/options/software',
      name: 'Software',
      meta: {
        title: '软件使用协议',
        public: true
      },
      component: () =>
        import( /* webpackChunkName: "options" */ '@/views/options/Software')
    },
    {
      path: '/options/taxiAgreement',
      name: 'TaxiAgreement',
      meta: {
        title: '出租车服务协议',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "options" */
          '@/views/options/TaxiAgreement'
        )
    },
    {
      path: '/options/trainAgreement',
      name: 'TrainAgreement',
      meta: {
        title: '火车票用户服务协议',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "options" */
          '@/views/options/TrainAgreement'
        )
    },
    {
      path: '/options/trainUserAgreement',
      name: 'TrainUserAgreement',
      meta: {
        title: '12306账户授权协议',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "options" */
          '@/views/options/TrainUserAgreement'
        )
    },
    {
      path: '/options/intercityOrderCancelRule',
      name: 'IntercityOrderCancelRule',
      meta: {
        title: '城际订单取消规则',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "options" */
          '@/views/options/IntercityOrderCancelRule'
        )
    },
    {
      path: '/options/taxiOrderCancelRule',
      name: 'TaxiOrderCancelRule',
      meta: {
        title: '出租车订单取消规则',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "options" */
          '@/views/options/TaxiOrderCancelRule'
        )
    },
    {
      path: '/options/trainNotes',
      name: 'TrainNotes',
      meta: {
        title: '火车票预定须知',
        public: true
      },
      component: () =>
        import( /* webpackChunkName: "options" */ '@/views/options/TrainNotes')
    },
    {
      path: '/options/trainRetreatNotes',
      name: 'TrainRetreatNotes',
      meta: {
        title: '火车票退改签须知',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "options" */
          '@/views/options/TrainRetreatNotes'
        )
    },
    {
      path: '/options/privacy',
      name: 'Privacy',
      meta: {
        title: '个人信息保护及隐私政策',
        public: true
      },
      component: () =>
        import( /* webpackChunkName: "options" */ '@/views/options/Privacy')
    },
    {
      path: '/notice',
      name: 'Notice',
      meta: {
        title: '合伙人招募公告'
      },
      component: () => import('@/views/notice/notice')
    },
    {
      path: '/infouploader',
      name: 'InfoUploader',
      meta: {
        title: '司机信息上传',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "options" */
          '@/views/infouploader/InfoUploader'
        )
    },
    /* 城际司机招募 司机端*/
    {
      path: '/intercitydriver/enterpagedriver',
      name: 'enterpagedriver',
      meta: {
        title: '司机招募',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "intercityDriver" */
          '@/views/intercityDriver/enterpagedriver'
        )
    },
    /* 城际司机招募 */
    {
      path: '/intercitydriver/enterpage',
      name: 'enterpage',
      meta: {
        title: '司机招募',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "intercityDriver" */
          '@/views/intercityDriver/enterpage'
        )
    },
    {
      path: '/intercitydriver/signaward',
      name: 'signAward',
      meta: {
        title: '司机招募',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "intercityDriver" */
          '@/views/intercityDriver/signAward'
        )
    },
    {
      path: '/intercitydriver/driverAttention',
      name: 'DriverAttention',
      meta: {
        title: '司机招募条件',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "intercityDriver" */
          '@/views/intercityDriver/driverAttention'
        )
    },
    {
      path: '/intercitydriver/recruitfalse',
      name: 'recruitfalse',
      meta: {
        title: '注册失败',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "intercityDriver" */
          '@/views/intercityDriver/recruitfalse'
        )
    },
    {
      path: '/intercitydriver/recruitsuccess',
      name: 'recruitsuccess',
      meta: {
        title: '注册成功',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "intercityDriver" */
          '@/views/intercityDriver/recruitsuccess'
        )
    },
    {
      path: '/intercitydriver/recruitwait',
      name: 'recruitwait',
      meta: {
        title: '注册中',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "intercityDriver" */
          '@/views/intercityDriver/recruitwait'
        )
    },
    {
      path: '/intercitydriver/fillInfo',
      name: 'fillInfo',
      meta: {
        title: '司机招募',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "intercityDriver" */
          '@/views/intercityDriver/fillInfo'
        )
    },
    /**
     *  市内车主 出租车车主司机招募
     */
    {
      path: '/driverrecruitment/register',
      name: 'register',
      meta: {
        title: '市内司机注册',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "driverRecruitment" */
          '@/views/driverRecruitment/register'
        )
    },
    {
      path: '/driverrecruitment/driverindex',
      name: 'driverIndex',
      meta: {
        title: '市内司机注册',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "driverRecruitment" */
          '@/views/driverRecruitment/driverIndex'
        )
    },

    {
      path: '/driverrecruitment/drivertype',
      name: 'driverType',
      meta: {
        title: '市内司机注册',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "driverRecruitment" */
          '@/views/driverRecruitment/driverType'
        )
    },
    {
      path: '/driverrecruitment/drivercity',
      name: 'driverCity',
      meta: {
        title: '市内司机注册',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "driverRecruitment" */
          '@/views/driverRecruitment/driverCity'
        )
    },
    {
      path: '/driverrecruitment/driverQuickIdentity',
      name: 'driverQuickIdentity',
      meta: {
        title: '市内司机注册',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "driverRecruitment" */
          '@/views/driverRecruitment/driverQuickIdentity'
        )
    },
    {
      path: '/driverrecruitment/citylist',
      name: 'cityList',
      meta: {
        title: '选择城市',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "driverRecruitment" */
          '@/views/driverRecruitment/cityList'
        )
    },
    {
      path: '/driverrecruitment/driverstatus',
      name: 'driverStatus',
      meta: {
        title: '市内司机审核',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "driverRecruitment" */
          '@/views/driverRecruitment/driverStatus'
        )
    },
    {
      path: '/driverrecruitment/driveridentity',
      name: 'driverIdentity',
      meta: {
        title: '完善身份信息',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "driverRecruitment" */
          '@/views/driverRecruitment/driverIdentity'
        )
    },

    {
      path: '/driverrecruitment/drivercompany',
      name: 'driverCompany',
      meta: {
        title: '完善公司信息',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "driverRecruitment" */
          '@/views/driverRecruitment/driverCompany'
        )
    },
    {
      path: '/driverrecruitment/drivertxfirminfo',
      name: 'driverTxFirmInfo',
      meta: {
        title: '选择出租车公司',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "driverRecruitment" */
          '@/views/driverRecruitment/driverTxFirmInfo'
        )
    },

    {
      path: '/driverrecruitment/drivervehicle',
      name: 'driverVehicle',
      meta: {
        title: '完善车辆信息',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "driverRecruitment" */
          '@/views/driverRecruitment/driverVehicle'
        )
    },

    {
      path: '/driverrecruitment/driverpractitioners',
      name: 'driverPractitioners',
      meta: {
        title: '完善从业信息',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "driverRecruitment" */
          '@/views/driverRecruitment/driverPractitioners'
        )
    },

    {
      path: '/jeeplus/jigoutixian/wxauth',
      name: 'JigoutixianWxauth',
      meta: {
        public: true
      },
      component: () =>
        import( /*webpackChunkName: "jeeplus"*/ '@/views/jeeplus/jigoutixian')
    },
    {
      path: '/minihome',
      name: 'MiniHome',
      meta: {
        title: '平安到家',
        public: true
      },
      component: () =>
        import( /* webpackChunkName: "home"*/ '@/views/home/minihome')
    },
    {
      path: '/',
      redirect: '/login'
    },
    {
      path: '/login.html',
      redirect: '/login'
    },
    {
      path: '*',
      redirect: '/pagenotfound' // 如果找不到输入的页面就转入404
    },
    //----------------------------------------顺风车--------------------------------------
    {
      path: '/hitchhike',
      name: 'homeHitchhike',
      meta: {
        title: '顺风车',
        public: false
      },
      component: () =>
        import(
          /* webpackChunkName: "hitchhike" */
          '@/views/hitchhike/HomeHitchhike'
        )
    },
    {
      path: '/hitchhike/commonroute',
      name: 'hitchCommonRoute',
      meta: {
        title: '设置上下班路线',
        public: false
      },
      component: () =>
        import(
          /* webpackChunkName: "hitchhike" */
          '@/views/hitchhike/CommonRoute'
        )
    },
    {
      path: '/hitchhike/orderform',
      name: 'HitchOrderForm',
      meta: {
        title: '发布行程',
        public: false
      },
      component: () =>
        import(
          /* webpackChunkName: "hitchhike" */
          '@/views/hitchhike/OrderForm.vue'
        )
    },
    {
      path: '/hitchhike/waitinglobby',
      name: 'HitchWaitingLobby',
      meta: {
        title: '等待车主接单',
        public: false
      },
      component: () =>
        import(
          /* webpackChunkName: "hitchhike" */
          '@/views/hitchhike/WaitingLobby.vue'
        )
    },
    {
      path: '/hitchhike/invitationorder',
      name: 'HitchInvitationOrder',
      meta: {
        title: '邀请接单',
        public: false
      },
      component: () =>
        import(
          /* webpackChunkName: "hitchhike" */
          '@/views/hitchhike/invitationOrder'
        )
    },
    {
      path: '/hitchhike/colleagueorder',
      name: 'hitchColleagueOrder',
      meta: {
        title: '确认同行',
        public: false
      },
      component: () =>
        import(
          /* webpackChunkName: "hitchhike" */
          '@/views/hitchhike/colleagueOrder'
        )
    },
    {
      path: '/hitchhike/paymentorder',
      name: 'HitchPaymentOrder',
      meta: {
        title: '支付订单',
        public: false
      },
      component: () =>
        import(
          /* webpackChunkName: "hitchhike" */
          '@/views/hitchhike/colleagueOrder'
        )
    },
    {
      path: '/hitchhike/hitchorderdetail',
      name: 'hitchOrderDetail',
      meta: {
        title: '订单详情',
        public: false
      },
      component: () =>
        import(
          /* webpackChunkName: "hitchhike" */
          '@/views/hitchhike/hitchOrderDetail'
        )
    },
    {
      path: '/hitchhike/chargesdetails',
      name: 'hitchhikeChargesDetails',
      meta: {
        title: '费用明细',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "hitchhike" */
          '@/views/hitchhike/chargesDetails/chargesDetails'
        )
    },
    {
      path: '/hitchhike/valuationrules',
      name: 'hitchhikeValuationRules',
      meta: {
        title: '计价规则',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "hitchhike" */
          '@/views/hitchhike/chargesDetails/valuationRules'
        )
    },
    {
      path: '/hitchhike/my/myhome',
      name: 'hitchhikeMyHome',
      meta: {
        title: '我的顺风车',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "hitchhike" */
          '@/views/hitchhike/my/myHome'
        )
    },
    {
      path: '/hitchhike/my/editprofile',
      name: 'hitchhikeEditprofile',
      meta: {
        title: '编辑个人资料',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "hitchhike" */
          '@/views/hitchhike/my/editprofile'
        )
    },
    {
      path: '/hitchhike/my/myAllot',
      name: 'hitchhikeMyAllot',
      meta: {
        title: '顺风车行程',
        public: false
      },
      component: () =>
        import(
          /* webpackChunkName: "hitchhike" */
          '@/views/hitchhike/my/myAllot'
        )
    },
    {
      path: '/hitchhike/my/hitchsafe',
      name: 'hitchhikeSafe',
      meta: {
        title: '一键报警',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "hitchhike" */
          '@/views/hitchhike/my/hitchSafe'
        )
    },
    {
      path: '/hitchhike/my/safetycenter',
      name: 'hitchhikeSafetyCenter',
      meta: {
        title: '安全中心',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "hitchhike" */
          '@/views/hitchhike/my/safetyCenter'
        )
    },
    {
      path: '/hitchhike/my/safetyquestion',
      name: 'hitchhikeSafetyQuestion',
      meta: {
        title: '顺风车安全问答',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "hitchhike" */
          '@/views/hitchhike/my/safetyQuestion'
        )
    },
    {
      path: '/hitchhike/my/blacklist',
      name: 'hitchhikeBlackList',
      meta: {
        title: '黑名单',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "hitchhike" */
          '@/views/hitchhike/my/blackList'
        )
    },
    {
      path: '/hitchhike/hitchcancel',
      name: 'hitchCancel',
      meta: {
        title: '取消原因',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "hitchhike" */
          '@/views/hitchhike/hitchCancel'
        )
    },
    {
      path: '/hitchhike/hitchcancelrule',
      name: 'hitchCancelRule',
      meta: {
        title: '取消规则',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "hitchhike" */
          '@/views/hitchhike/hitchCancelRule'
        )
    },
    {
      path: '/hitchhikedriver/hitchlogin',
      name: 'hitchLogin',
      meta: {
        title: '顺风车司机登录',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "hitchhike" */
          '@/views/hitchhikedriver/hitchlogin'
        )
    },
    {
      path: '/hitchhikedriver/carregister',
      name: 'carRegister',
      meta: {
        title: '车辆认证',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "hitchhike" */
          '@/views/hitchhikedriver/carRegister'
        )
    },
    {
      path: '/hitchhikedriver/ownerregister',
      name: 'ownerRegister',
      meta: {
        title: '车主认证',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "hitchhike" */
          '@/views/hitchhikedriver/ownerRegister'
        )
    },
    {
      path: '/hitchhikedriver/registerstatus',
      name: 'hitchRegisterStatus',
      meta: {
        title: '审核状态',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "hitchhike" */
          '@/views/hitchhikedriver/registerStatus'
        )
    },
    {
      path: '/hitchhikedriver/my/myhome',
      name: 'driverMyHome',
      meta: {
        title: '我的顺风车',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "hitchhike" */
          '@/views/hitchhikedriver/my/myHome'
        )
    },
    {
      path: '/hitchhikedriver/my/managementcar',
      name: 'hitchManagementCar',
      meta: {
        title: '车辆管理',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "hitchhike" */
          '@/views/hitchhikedriver/my/managementCar'
        )
    },
    {
      path: '/hitchhikedriver/my/hitchwallet',
      name: 'hitchWallet',
      meta: {
        title: '顺风车费',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "hitchhike" */
          '@/views/hitchhikedriver/my/hitchWallet'
        )
    },
    {
      path: '/hitchhikedriver/my/hitchwalletdetail',
      name: 'hitchWalletDetail',
      meta: {
        title: '全部流水',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "hitchhike" */
          '@/views/hitchhikedriver/my/hitchWalletDetail'
        )
    },
    {
      path: '/hitchhikedriver/hitchdrivercancel',
      name: 'hitchDriverCancel',
      meta: {
        title: '取消原因',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "hitchhike" */
          '@/views/hitchhikedriver/hitchDriverCancel'
        )
    },
    {
      path: '/hitchhikedriver/hitchdrivercancelrule',
      name: 'hitchDriverCancelRule',
      meta: {
        title: '取消规则',
        public: true
      },
      component: () =>
        import(
          /* webpackChunkName: "hitchhike" */
          '@/views/hitchhikedriver/hitchDriverCancelRule'
        )
    },
    {
      path: '/hitchhikedriver/chargesdriverdetails',
      name: 'hitchChargesDriverDetails',
      meta: {
        title: '车费明细',
        public: false
      },
      component: () =>
        import(
          /* webpackChunkName: "hitchhike" */
          '@/views/hitchhikedriver/chargesDetails/chargesDriverDetails'
        )
    },
    {
      path: '/hitchhikedriver/valuationdriverrules',
      name: 'hitchValuationDriverRules',
      meta: {
        title: '计价规则',
        public: false
      },
      component: () =>
        import(
          /* webpackChunkName: "hitchhike" */
          '@/views/hitchhikedriver/chargesDetails/valuationDriverRules'
        )
    }
  ]
});

router.beforeEach((to, from, next) => {
  Loading.show();
  /* 路由发生变化修改页面title */
  if (to.meta.title) {
    document.title = to.meta.title;
  }
  /* 如果用户没有登录则跳转登录页面 */
  if (!to.meta.public) {
    let loggedIn = localStorage.getItem('USER_INFO');
    if (!loggedIn) {
      TokenOutDialog.show('您还没有登录');
      return;
    }
  }
  next();
});
router.afterEach((to, from) => {
  Loading.hide();
});
export default router;